package com.example.dql.diary.activity;

import android.app.Activity;
import android.app.ActivityOptions;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.transition.Slide;
import android.transition.Transition;

import com.airbnb.lottie.LottieAnimationView;
import com.example.dql.diary.MainActivity;
import com.example.dql.diary.R;
import com.gyf.barlibrary.ImmersionBar;

import butterknife.BindView;
import butterknife.ButterKnife;

public class WelcomeActivity extends BaseActivity {

    @BindView(R.id.animation_view)
    LottieAnimationView animationView;

    @Override
    public int getLayoutId() {
        return R.layout.activity_welcome;
    }

    @Override
    public Activity bindActivity() {
        return this;
    }

    @Override
    public void init() {
        ImmersionBar.with(this).init();
        animationView.setAnimation("cdx.json");
        animationView.playAnimation();
        Handler handler = new Handler();
        handler.postDelayed(new Runnable() {
            @Override
            public void run() {
                startActivity(new Intent(WelcomeActivity.this, MainActivity.class)/*, ActivityOptions.makeSceneTransitionAnimation(WelcomeActivity.this).toBundle()*/);
                finish();
            }
        },4000);
       /* Transition transition =  new Slide();
        transition.setDuration(1500);
        getWindow().setExitTransition(transition);*/

    }

}
